<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // true  和  false (少) 
        // Boolean() 

        // 什么情况下 转成  false 
        // 0
        // undefined
        // null 
        // '' 空字符串
        // NaN

        var num = 10;
        var a;
        var obj = null;
        console.log(Boolean(a)); // false
        console.log(Boolean(obj)); // false
        console.log(Boolean(num)); // true
        console.log(Boolean(0)); // false
        console.log(Boolean(-1)); // true
        console.log(Boolean(10.1)); //true
        console.log(Boolean(NaN)); //false

        console.log(Boolean('hello')); // true
        console.log(Boolean(''));  // false
        console.log(Boolean('   ')); // true


        // 隐式转换 采用的   Boolean() 
    </script>
</body>
</html>